.\" -*- nroff -*-
.\" Copyright 2013 Los Alamos National Security, LLC. All rights reserved.
.\" Copyright 2010 Cisco Systems, Inc.  All rights reserved.
.\" Copyright 2006-2008 Sun Microsystems, Inc.
.\" Copyright (c) 1996 Thinking Machines Corporation
.\" Copyright (c) 2020      Google, LLC. All rights reserved.
.\" $COPYRIGHT$
.TH MPI_Info_get 3 "#OMPI_DATE#" "#PACKAGE_VERSION#" "#PACKAGE_NAME#"
.SH NAME
\fBMPI_Info_get_string\fP \- Retrieves the value associated with a key in an info object.

.SH SYNTAX
.ft R
.SH C Syntax
.nf
#include <mpi.h>
int MPI_Info_get_string(MPI_Info \fIinfo\fP, const char \fI*key\fP, int *\fIbuflen\fP, char \fI*value\fP, int *\fIflag\fP)

.fi
.SH Fortran Syntax
.nf
USE MPI
! or the older form: INCLUDE 'mpif.h'
MPI_INFO_GET_STRING(\fIINFO, KEY, BUFLEN, VALUE, FLAG, IERROR\fP)
	INTEGER	\fIINFO, BUFLEN, IERROR\fP
	CHARACTER*(*) \fIKEY, VALUE\fP
	LOGICAL \fIFLAG\fP

.fi
.SH Fortran 2008 Syntax
.nf
USE mpi_f08
MPI_Info_get_string(\fIinfo\fP, \fIkey\fP, \fIbuflen\fP, \fIvalue\fP, \fIflag\fP, \fIierror\fP)
	TYPE(MPI_Info), INTENT(IN) :: \fIinfo\fP
	CHARACTER(LEN=*), INTENT(IN) :: \fIkey\fP
	INTEGER, INTENT(INOUT) :: \fIbuflen\fP
	CHARACTER(LEN=valuelen), INTENT(OUT) :: \fIvalue\fP
	LOGICAL, INTENT(OUT) :: \fIflag\fP
	INTEGER, OPTIONAL, INTENT(OUT) :: \fIierror\fP

.fi
.SH INPUT PARAMETERS
.ft R
.TP 1i
info
Info object (handle).
.ft R
.TP 1i
key
Key (string).

.SH OUTPUT PARAMETER
.ft R
.ft 1i
buflen
On entry, length of value arg.  On return, set to required size to hold value string (integer).
.ft R
.TP 1i
value
Value (string).
.ft R
.TP 1i
flag
Returns true if key defined, false if not (boolean).
.ft R
.TP 1i
IERROR
Fortran only: Error status (integer).

.SH DESCRIPTION
.ft R
MPI_Info_get_string retrieves the value associated with \fIkey\fP from \fIinfo\fP, if any. If such a key exists in info, it sets \fIflag\fP to true and returns the value in \fIvalue\fP, otherwise it sets 
flag to false and leaves value unchanged. \fIbuflen\fP on input is the size of the provided buffer, for the output of buflen it is the size of the buffer needed to store the value string. 
If the buflen passed into the function is less than the actual size needed to store the value string (including null terminator in C), the value is truncated. On return, 
the value of \fIbuflen\fP will be set to the required buffer size to hold the value string. If buflen is set to 0, value is not changed. In C, \fIbuflen\fP includes the required space for the 
null terminator. In C, this function returns a null terminated string in all cases where the \fIbuflen\fP input value is greater than 0.

If \fIkey\fP is larger than MPI_MAX_INFO_KEY, the call is erroneous.

.SH ERRORS
Almost all MPI routines return an error value; C routines as the value of the function and Fortran routines in the last argument.
.sp
Before the error value is returned, the current MPI error handler is
called. By default, this error handler aborts the MPI job, except for I/O function errors. The error handler may be changed with MPI_Comm_set_errhandler; the predefined error handler MPI_ERRORS_RETURN may be used to cause error values to be returned. Note that MPI does not guarantee that an MPI program can continue past an error.

.SH SEE ALSO
.ft r
MPI_Info_create
.br
MPI_Info_delete
.br
MPI_Info_dup
.br
MPI_Info_free
.br
MPI_Info_get_nkeys
.br
MPI_Info_get_nthkey
.br
MPI_Info_set
.br

